package com.atstudent.gmall.product.controller;

import com.atstudent.gmall.common.result.Result;
import com.atstudent.gmall.product.entity.BaseSaleAttr;
import com.atstudent.gmall.product.service.BaseSaleAttrService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 所有销售属性
 * @Author 薛有朋
 * @CreatDate 2024/11/24 21:55
 **/
@RestController
@RequestMapping(value = "/admin/product")
public class BaseSaleAttrController {

    @Autowired
    private BaseSaleAttrService baseSaleAttrService;

    /*
     * 获取所有销售属性
     * @Author 薛有朋
     * @Date 2024/11/24 21:56
     **/
    @GetMapping(value = "/baseSaleAttrList")
    public Result<List<BaseSaleAttr>> findAll(){
        List<BaseSaleAttr> baseSaleAttrList = baseSaleAttrService.findAll();
        return Result.ok(baseSaleAttrList);
    }
}
